package com.lakeworks.service.impl;

import com.lakeworks.common.core.text.Convert;
import com.lakeworks.common.domain.ticket.TktFlow;
import com.lakeworks.mapper.TktFlowMapper;
import com.lakeworks.service.ITktFlowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 流程定义Service业务层处理
 *
 * @author lake
 * @date 2023-07-17
 */
@Service
public class TktFlowServiceImpl implements ITktFlowService {
    @Autowired
    private TktFlowMapper tktFlowMapper;

    /**
     * 查询流程定义
     *
     * @param id 流程定义主键
     * @return 流程定义
     */
    @Override
    public TktFlow selectTktFlowById(Long id) {
        return tktFlowMapper.selectTktFlowById(id);
    }

    /**
     * 查询流程定义列表
     *
     * @param tktFlow 流程定义
     * @return 流程定义
     */
    @Override
    public List<TktFlow> selectTktFlowList(TktFlow tktFlow) {
        return tktFlowMapper.selectTktFlowList(tktFlow);
    }

    /**
     * 新增流程定义
     *
     * @param tktFlow 流程定义
     * @return 结果
     */
    @Override
    public int insertTktFlow(TktFlow tktFlow) {
        return tktFlowMapper.insertTktFlow(tktFlow);
    }

    /**
     * 修改流程定义
     *
     * @param tktFlow 流程定义
     * @return 结果
     */
    @Override
    public int updateTktFlow(TktFlow tktFlow) {
        return tktFlowMapper.updateTktFlow(tktFlow);
    }

    /**
     * 批量删除流程定义
     *
     * @param ids 需要删除的流程定义主键
     * @return 结果
     */
    @Override
    public int deleteTktFlowByIds(String ids) {
        return tktFlowMapper.deleteTktFlowByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除流程定义信息
     *
     * @param id 流程定义主键
     * @return 结果
     */
    @Override
    public int deleteTktFlowById(Long id) {
        return tktFlowMapper.deleteTktFlowById(id);
    }

    @Override
    public TktFlow selectTktFlowByName(String type) {
        return tktFlowMapper.selectTktFlowByName(type);
    }
}
